<?php if($this->res):?>
<?php $cities = $this->res;?>
<div id="vacancy" class="clearfix">
	<div style="float:left; width: 30%;">
		<?php $first = true;?>
		<?php foreach ($cities as $city):?>
			<?php if (isset($city['children'])):?>
				<?php $vacancy_count = count($city['children'])?>
				<a class="city <?=($first) ? 'active' : '' ?>" href="#<?=$city['id']?>"><span><?=$city['label']?></span>&nbsp;(<?=$vacancy_count?>)</a>
				<?php $first = false;?>
			<?php endif;?>
		<?php endforeach;?>	
	</div>
	<div style="float:left; width: 70%;">
		<?php  foreach ($cities as $city):?>
			<?php if (isset($city['children'])):?>
				<ul class="vacancy_list">
				<?php  foreach ($city['children'] as $vacancy):?>
					<li><a class="label active" href="#<?=$city['id']?>"><span><?=$vacancy['label']?></span></a><br class="clear"/>
						<div class="info">
							<?php if(!empty($vacancy['acting'])):?>
								<span>
								<b>Обязанности:</b><br/>
								<?=nl2br($vacancy['acting']) ?>
								</span>
							<?php endif;?>
							
							<?php if(!empty($vacancy['requirements'])):?>
								<span>
								<b>Требования:</b><br/>
								<?=nl2br($vacancy['requirements']) ?>
								</span>
							<?php endif;?>
						
							<?php if(!empty($vacancy['terms'])):?>
								<span><b>Условия:</b><br/>
								<?=nl2br($vacancy['terms']) ?>
								</span>
							<?php endif;?>
							
							<?php if(!empty($vacancy['type'])):?>
								<span><b>Тип занятости:</b><br/>
								<?=nl2br($vacancy['type']) ?>
								</span>
							<?php endif;?>
							
							<?php if(!empty($vacancy['dopinfo'])):?>
								<span><b>Дополнительная информация:</b><br/>
								<?=nl2br($vacancy['dopinfo']) ?>
								</span>
							<?php endif;?>
							
							<?php if(!empty($vacancy['contacts'])):?>
								<span class="contacts"><?=nl2br($vacancy['contacts']);?></span>
							<?php endif;?>
							
							<?php if(!empty($vacancy['email'])):?>
								<a style="background-color: white;" href="mailto:<?=$vacancy['email']?>" class="button"><span>Откликнуться на вакансию</span></a>
								<br/><br/>
							<?php endif;?>
						</div>
					</li>
				<?php endforeach;?>
				</ul>
			<?php endif;?>
		<?php endforeach;?>
	</div>
</div>
<? endif;?>